package day1;

/**
 * @author pacai
 * @version 1.0
 */
public class LogarCal {
    public static int[] randomArr(int maxLen,int maxVal){
        int[] arr = new int[(int)(Math.random()* maxLen) + 1];
        for (int i = 0; i < maxLen + 1; i++) {
            arr[i] = (int)(Math.random() * maxVal);
        }
        return arr;
    }

    public static int[] copyArr(int[] arr){
        int[] newArr = new int[arr.length];
        for (int i = 0; i < arr.length; i++) {
            newArr[i] = arr[i];
        }
        return newArr;
    }

    public static boolean equalArr(int[] arr1,int[] arr2){
        for (int i = 0; i < arr1.length; i++) {
            if(! (arr1[i] == arr2[i])){
                return false;
            }
        }
        return true;
    }

    public static void main(String[] args) {
        int times = 1000;
        int maxLen = 1000;
        int maxVal = 100000;
        int[] arr,arr2;
        for (int i = 0; i < times; i++) {
            arr = randomArr(maxLen, maxVal);
            arr2 = copyArr(arr);
        }

    }

}
